<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>feedbackPrint</title>
</head>
<link rel="stylesheet" type="text/css" href="../../css/dataTables.bootstrap.css" />
<link rel="stylesheet" type="text/css" href="../../css/bootstrap.min.css"/>
<link href="../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../js/jquery.min.js"></script>
<body onload="initDataTable()">
<table class="table table-striped table-bordered table-hover datatable" id="record_list">
    <thead>
    <tr>
        <th class="table-checkbox"><input type="checkbox" class="group-checkable" data-set="#record_list .checkboxes" /></th>
        <th>用户名</th>
        <th>反馈类型</th>
        <th>反馈内容</th>
        <th>反馈时间</th>
        <th>反馈状态</th>
    </tr>
    </thead>
</table>
</body>

<script type="text/javascript" src="../../js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="../../js/jquery.uniform.min.js"></script>
<script type="text/javascript" src="../../js/jquery.dataTables.min.js"></script>

<script>
    let result=[];
    function initDataTable(){
        $(".sure").click(function (){
            $(".tip").fadeOut(100);
        });
        // 2.弹窗的取消
        $(".cancel").click(function (){
            $(".tip").fadeOut(100);
        });
        $(".tiptop a").click(function (){
            $(".tip").fadeOut(100);
        });
        init();
    }
    function init(){
        $('.datatable').dataTable({
            "paging": true,
            "searching": true,
            "oLanguage": {
                "aria": {
                    "sortAscending": ": activate to sort column ascending",
                    "sortDescending": ": activate to sort column descending"
                },
                "sProcessing": "处理中...",
                "sLengthMenu": "_MENU_ 记录/页",
                "sZeroRecords": "没有匹配的记录",
                "sInfo": "显示第 _START_ 至 _END_ 项记录，共 _TOTAL_ 项",
                "sInfoEmpty": "显示第 0 至 0 项记录，共 0 项",
                "sInfoFiltered": "(由 _MAX_ 项记录过滤)",
                "sInfoPostFix": "",
                "sSearch": "查询:",
                "oPaginate": {
                    "sFirst": "首页",
                    "sPrevious": "上页",
                    "sNext": "下页",
                    "sLast": "末页"
                }
            },
            "aoColumns": [{
                "mRender": function (data, type, full) {
                    resultList.push(full);
                    sReturn = '<input type="checkbox" class="checkboxes" value="' + data + '"/>';
                    return sReturn;
                }, "orderable": true
            }, {
                "mRender": function (data, type, full) {
                    sReturn = "<div>"+full.feedbackAccount+"</div>";
                    return sReturn;
                }, "orderable": true
            }, {
                "mRender": function (data, type, full) {
                    let temp;
                    if(full.type==1){
                        temp="系统信息";
                    }else if(full.type==2){
                        temp="设备信息";
                    }else{
                        temp="用户信息";
                    }
                    sReturn = "<div>"+temp+"</div>";
                    return sReturn;
                }, "orderable": true
            }, {
                "mRender": function (data, type, full) {
                    sReturn = "<div>"+full.feedBackContent+"</div>";
                    return sReturn;
                }, "orderable": true
            }, {
                "mRender": function (data, type, full) {
                    sReturn ="<div>"+full.feedbackTime+"</div>";
                    return sReturn;
                }, "orderable": true
            },{
                "mRender": function (data, type, full) {
                    let temp;
                    if(full.isDealed==0){
                        temp="尚未处理";
                    }else{
                        temp="已处理"
                    }
                    sReturn = "<div>"+temp+"</div>";
                    return sReturn;
                }, "orderable": true
            },{
                "mRender": function (data, type, full) {
                    if(full.dealResult==null){
                        sReturn = "<div>null</div>";
                    }else{
                        sReturn = "<div>"+full.dealResult+"</div>";
                    }

                    return sReturn;
                }, "orderable": true
            },{
                "mRender": function (data, type, full) {
                    if(full.dealTime==null){
                        sReturn = "<div>null</div>";
                    }else{
                        sReturn = "<div>"+full.dealTime+"</div>";
                    }
                    return sReturn;
                }, "orderable": true
            },{
                "mRender": function (data, type, full) {
                    if(full.dealManageAccount==null){
                        sReturn = "<div>null</div>";
                    }else{
                        sReturn = "<div>"+full.dealManageAccount+"</div>";
                    }
                    return sReturn;
                }, "orderable": true
            }, {
                "mRender": function (data, type, full) {
                    sReturn = "<a href=\"javascript:ModifyFeedBack("+full.id+")\">【修改反馈】</a><a href=\"javascript:DeleteFeedBack(" + full.id + ")\">【删除反馈】</a>";
                    return sReturn;
                }, "orderable": true
            }],
            "aLengthMenu": [[5, 10, 15, 20, 25, 40, 50, -1], [5, 10, 15, 20, 25, 40, 50, "所有记录"]],
            "fnDrawCallback": function () {
                $(".checkboxes").uniform();
                $(".group-checkable").uniform();
            },
            "sAjaxSource": "../../Device_ServletAction?Action=getFeedbackRecord&account="+account+"&tag="+1
        });
        $('.datatable').find('.group-checkable').change(function () {
            var set = jQuery(this).attr("data-set");
            var checked = jQuery(this).is(":checked");
            jQuery(set).each(function () {
                if (checked) {
                    $(this).attr("checked", true);
                    $(this).parents('tr').addClass("active");
                } else {
                    $(this).attr("checked", false);
                    $(this).parents('tr').removeClass("active");
                }
            });
            jQuery.uniform.update(set);
        });
        $('.datatable').on('change', 'tbody tr .checkboxes', function () {
            $(this).parents('tr').toggleClass("active");
        });
    }
    function back(){
        window.location.href="../main.html";
        window.parent.frames['rightFrame'].location="deviceDatatable.html?_="+Math.random();
        alert("11111111111")
    }
</script>
</html>